Skip to content

fix: Refactor ESI login signal to dict and add portrait diagnostics#10

Merged
mogglemoss merged 1 commit intomasterfrom
fix/portrait-debug-and-esi-dict-signal
Mar 1, 2026
Merged

fix: Refactor ESI login signal to dict and add portrait diagnostics#10
mogglemoss merged 1 commit intomasterfrom
fix/portrait-debug-and-esi-dict-signal

Conversation

@mogglemoss
Copy link
Owner

Summary

  • Changed login_response signal from Signal(bool, str)Signal(dict) so is_ok, char_name, and char_id all travel together in a single atomic payload
  • Added diagnostic logging in _load_portrait and _on_portrait_loaded to trace portrait load failures on macOS
  • Added emoji status indicators in source toggle menu
  • Replaced QDialogButtonBox with explicit Save/Close buttons in the sources dialog

Context

After EVE SSO auth, the character name was updating correctly but the portrait was not swapping to the authenticated character's image. The root cause was that the original login signal carried (bool, str) — there was no clean path to deliver char_id to the portrait loader. A workaround had been added to handle "argument shifting" from PySide6's cross-thread signal delivery, but it was fragile.

Approach

Changed the signal to carry a dict payload instead of positional args. This eliminates the argument-shift problem entirely — all login data arrives together regardless of how PySide6 queues the cross-thread delivery. The char_id is now explicitly cast to int at the ESI layer before packing into the dict.

The portrait diagnostic logging will surface exactly where the failure is (wrong char_id, network error, or image decode failure) so we can follow up with a targeted fix.

Test plan

  • Trigger a GitHub Actions build and download the macOS DMG artifact
  • Log in via EVE SSO and verify character name updates
  • Check application logs to confirm portrait URL contains correct char_id
  • Verify portrait image swaps to authenticated character after login
  • Verify portrait reverts to placeholder on logout

🤖 Generated with Claude Code

The original login signal passed (bool, str) but needed to carry char_id
as well for portrait loading. PySide6's cross-thread signal delivery was
occasionally mangling positional arguments, causing char_id to be missing
or misread, which prevented the character portrait from updating after EVE SSO.

Changes:
- Changed login_response signal from Signal(bool, str) to Signal(dict) so
  all login data (is_ok, char_name, char_id) travels together atomically,
  eliminating argument-shift bugs from threaded signal delivery
- Updated ESI.handle_login to pass a typed dict with explicit int() and str()
  casts for CharacterID and CharacterName from the ESI verify response
- Updated ESIProcessor._login_callback and login_handler slot accordingly
- Added diagnostic logging to _load_portrait and _on_portrait_loaded to
  trace char_id, URL, response size, and image decode success so we can
  identify exactly where portrait loading fails on macOS
- Added emoji status indicators to source menu entries in gui_source_toggles
- Replaced QDialogButtonBox with explicit Save/Close buttons in gui_sources
  to fix the Save button not working as expected in the sources dialog

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mogglemoss mogglemoss merged commit 919d685 into master Mar 1, 2026
4 checks passed
@mogglemoss mogglemoss deleted the fix/portrait-debug-and-esi-dict-signal branch March 1, 2026 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant